//
//  Test1Model.m
//  RacMVVM
//
//  Created by 崔博 on 2018/11/28.
//  Copyright © 2018年 崔博. All rights reserved.
//

#import "Test1Model.h"
#import "TestViewModel.h"
@implementation Test1Model
- (void)initialize
{
    [super initialize];
    self.perPage = 10;
    self.didSelectCommand = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(NSIndexPath * input) {
        TestViewModel * vieModel = [[TestViewModel alloc] initWithService:self.services parms:nil];
        [self.services pushViewModel:vieModel animated:YES];
        return [RACSignal empty];
    }];

}

- (RACSignal *)requestRemoteDataSignalWithPage:(NSUInteger)page
{
    NSLog(@"%zd",page);
    return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
        self.users = @[@[@"1"],@[@"2"],@[@"1"],@[@"2"],@[@"1"],@[@"2"],@[@"2"],@[@"1"],@[@"2"],@[@"2"],@[@"1"],@[@"2"],@[@"2"],@[@"1"],@[@"2"],@[@"2"],@[@"1"],@[@"2"],@[@"2"],@[@"1"],@[@"2"]];
        [subscriber sendNext:@"123"];
        [subscriber sendCompleted];
        return nil;
    }];
}
@end
